package com.brkj.communityStudy;

import com.brkj.communityStudy.model.DS_QAStudy;
import com.brkj.httpInterface.BaseAjaxParams;
import com.brkj.httpInterface.HttpInterface;
import com.brkj.model.DS_Course;
import com.brkj.util.MyAjaxCallBack;
import com.brkj.util.MyApplication;
import com.brkj.util.view.BaseCoreActivity;
import com.google.gson.Gson;
import net.tsz.afinal.FinalHttp;

/**
 * Created by colin.ding on 2014/6/9.
 */
public class QADetailGetByIDActivity extends QADetailActivity{

    @Override
    protected void getQAData() {
        BaseAjaxParams params = new BaseAjaxParams();
        params.put(HttpInterface.HIF_GetQAByContentID.params.QuestionID,getIntent().getStringExtra("QAID"));

        FinalHttp fh = new FinalHttp();
        fh.post(HttpInterface.HIF_GetQAByContentID.address, params, new MyAjaxCallBack<Object>((BaseCoreActivity)this) {
            @Override
            public void onSuccess(Object o) {
                super.onSuccess(o);
                Gson gson = new Gson();
                qa = gson.fromJson((String)o, DS_QAStudy.class);
                initQA();
            }
        });
    }
}
